package cn.lee.cplibrary.widget.tv;

import android.annotation.SuppressLint;
import android.text.TextPaint;
import android.text.style.URLSpan;

import cn.lee.cplibrary.init.CPInitializer;

/**
 * Created by chrislee on 21/7/19.
 * 去掉TextView设置autoLink属性后的下划线
 */

@SuppressLint("ParcelCreator")
public class NoUnderlineSpan extends URLSpan {
    public NoUnderlineSpan(String url) {
        super(url);
        CPInitializer.checkInitialization();
    }

    @Override
    public void updateDrawState(TextPaint ds) {
        if (ds != null) {
            ds.setColor(ds.linkColor);
            ds.setUnderlineText(false);
        }
    }

}